/*
 * Rook.cpp
 *
 *  Created on: Mar 30, 2011
 *      Author: cnwilson
 */


#include "../inc/Rook.h"


Rook::Rook(Color _color,Position _pos): Piece(_color,_pos,ROOK){

}

vector<Position> Rook::getPotentialMoves(){
	vector<Position> moves;
	Position col1(0,1),col2(0,-1),row1(-1,0),row2(1,0);

	Position temp(pos+col1);
	while (temp<BOARDSIZE)
	{
		moves.push_back(temp);
		temp+=col1;
	}

	temp=pos+col2;
	while (temp>0)
	{
		moves.push_back(temp);
		temp+=col1;
	}

	temp=pos+row1;
	while (temp>0)
	{
		moves.push_back(temp);
		temp+=row1;
	}

	temp=pos+row2;
	while (temp<BOARDSIZE)
	{
		moves.push_back(temp);
		temp+=row2;
	}
	return moves;
}
